As may be appreciated, it is oftentimes beneficial to be able to compare different versions or copies of a document in a manner such that a differential document is produced to detail changes between the versions or copies. It is especially beneficial to be able to do so in an automated electronic manner when the document versions or copies are in electronic form. With such a differential document, for example, one may be able to discern slight changes between versions of a document that would otherwise go unnoticed. Similarly, one can determine whether two copies of a document are identical, or whether one of the copies has been changed. In either case, such changes can be set forth clearly within the differential document.
Note, too that with such a differential document setting forth the changes between a first version and a second version of a document, the second version of the document may be produced by properly applying the changes in the differential document to the first version of the document. Accordingly, if a recipient of a first version of a document is to also receive a second, updated version of the document, such recipient may instead be provided with a corresponding differential document with instructions to produce the second version of the document by applying the changes in the differential document to the first version of the document. Especially in the case where the documents are relatively large and the changes as embodied in the corresponding differential document are relatively small, providing the differential document rather than the second version of the document is clearly more desirable, especially if delivery is effectuated electronically.
Thus, the differential document may be employed as a source control or delta-encoding file in connection with, for example, an array of servers caching a document. Changes to the document on one server can be sent over a network to the other servers, and rather than creating unnecessary network load by trying to ship the entire document between servers, each server can receive a differential document embodying the changes.
The present invention provides a tool for comparing first and second documents and noting the changes therebetween. Specifically, the present invention provides a tool for comparing two hierarchical documents such as XML (eXtensible Markup Language) documents and noting the changes therebetween in a hierarchical differential document such as an XML differential document. The invention employs a hierarchically based differential language to describe the changes between the documents, where the language is able to represent the addition, change, or removal of hierarchical nodes and fragments, as well as more complex changes like a move of a hierarchical fragment. The hierarchical differential document thus represents the changes as a structured tree of operations that can be applied to the first hierarchical document to produce the second (changed) hierarchical document.